import request from '@/utils/request'

// 获取盘点区域下拉列表
export function getAreaList() {
  return request({
    url: '/operation/web/plan/areaList',
    method: 'get'
  })
}

// 获取设备类型下拉列表
export function getEquipmentTypeList() {
  return request({
    url: '/operation/web/plan/equipmentTypeList',
    method: 'get'
  })
}

// 获取盘点设备下拉列表
export function getDeviceList(area) {
  return request({
    url: '/operation/web/plan/deviceList',
    method: 'get',
    params: { area }
  })
}

// 查询设备资产盘点列表
export function listInventoryPlan(params) {
  return request({
    url: '/operation/web/plan/list',
    method: 'get',
    params
  })
}

// 获取设备资产盘点详细信息
export function getInventoryPlanDetail(id) {
  return request({
    url: `/operation/web/plan/${id}`,
    method: 'get'
  })
}

// 新增设备资产盘点
export function addInventoryPlan(data) {
  return request({
    url: '/operation/web/plan',
    method: 'post',
    data
  })
}

// 修改设备资产盘点
export function updateInventoryPlan(data) {
  return request({
    url: '/operation/web/plan',
    method: 'put',
    data
  })
}

// 完成盘点
export function completeInventoryPlan(data) {
  return request({
    url: '/operation/web/plan/complete',
    method: 'put',
    data
  })
}

// 删除设备资产盘点
export function deleteInventoryPlan(ids) {
  return request({
    url: `/operation/web/plan/${ids}`,
    method: 'delete'
  })
}